﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AjaxSnippets.WebApplicationExample.RelayFieldsPage" %>
<%@ Register assembly="AjaxSnippets" namespace="AjaxSnippets" tagprefix="ajaxsnippets" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/RelayFields/Service.asmx" />
        </Services>
        <Scripts>
            <asp:ScriptReference Assembly="AjaxSnippets" Name="AjaxSnippets.SnippetManager.js" />
        </Scripts>
        </asp:ScriptManager>
        <ajaxsnippets:SnippetManager ID="SnippetManager1" runat="server" />
        <script language="javascript" type="text/javascript">
            function getSnippet() {
                AjaxSnippets.WebApplicationExample.RelayFieldsSnippetService.GetRelayFieldsSnippet(
                getSnippetSuccess, getSnippetError
                );
            }

            function getSnippetSuccess(result) {
                AjaxSnippets.SnippetManager.renderSnippet(result, 'output');
            }

            function getSnippetError(error, userContext, methodName) {
                alert(error.get_message());
            }

            function beforeRelayFields() {

            }
            function relayFieldsSuccess(result) {
                alert(result);
            }
            function relayFieldsFailed(error, userContext, methodName) {
                alert(error.get_message());
            }
        </script>
        <button onclick="getSnippet(); return false;">Get Snippet</button>
        <div id="output"></div>        
    </div>
    </form>
</body>
</html>
